package com.example.springbootjackson.enums;

import lombok.Getter;
import org.springframework.stereotype.Component;

/**
 * erp 协议状态枚举
 * @Author : Magic Jwz
 */
@Getter
@EnumsInterface
public enum ErpAgreementStatusEnum {

    WAIT_SUBMIT(12301, "待提交"),
    WAIT_EXE(12302, "待执行"),
    EXECUTING(12303, "执行中"),
    CANCELED(12304, "已作废"),
    COMPLETED(12305, "已完成")
    ;

    ErpAgreementStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private Integer code;
    private String desc;


    public static ErpAgreementStatusEnum ofCode(Integer code){
        ErpAgreementStatusEnum[] values = ErpAgreementStatusEnum.values();
        for (ErpAgreementStatusEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }


}
